package com.yjh.auth.entity;


import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;


import javax.persistence.Table;
import java.io.Serializable;
import java.util.Collection;

public class DetailsUser extends User implements Serializable {

    /**
     * 用户ID
     */
    @Getter
    private Integer id;
    /**
     * 部门ID
     */
    @Getter
    private Integer deptId;

    /**
     * 租户ID
     */
    @Getter
    private Integer tenantId;

    @Getter
    @Setter
    private String wechatSessionId;
    /**
     * 头像
     */
    @Getter
    @Setter
    private String avatar;

    public DetailsUser(Integer id, Integer deptId, Integer tenantId, String avatar, String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
        this.id = id;
        this.deptId = deptId;
        this.tenantId = tenantId;
        this.avatar = avatar;
    }

    public DetailsUser(Integer id, Integer deptId, Integer tenantId,String avatar, String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
        this.id = id;
        this.deptId = deptId;
        this.tenantId = tenantId;
        this.avatar = avatar;
    }

}
